class pet():
    def __init__(self,name,animal,color):
        self.name = name
        self.animal = animal
        self.color = color
        self.age = 2

    def get_pet(self):
        pet_info = str(self.name)+'是一只'+str(self.color)+'的'+str(self.animal)
        return pet_info

    def updata_pet_age(self,set_age):
        self.age = set_age

    def get_age(self):
        print('我的宠物今年'+str(self.age)+'岁了')

    def small_home(self):
        print('我的宠物使用小笼子')



# my_pet = pet('加菲','猫','黄色')
#
# # my_pet.age = 5
#
# my_pet.updata_pet_age(3)
#
# print(my_pet.get_pet())
#
# my_pet.get_age()

class big_pet(pet):
    def __init__(self, name, animal, color):
        super().__init__(name, animal, color)
        self.long = 2

    def get_long(self):
        print('它的体长是'+str(self.long)+'米')

    def small_home(self):
        print('我的宠物很大，不需要小笼子')

my_big_pet = big_pet('小糊涂','藏獒','黑色')

print(my_big_pet.get_pet())
my_big_pet.get_long()
my_big_pet.small_home()


